<?php
// 查看联系方式
$user_id=$_SESSION['home_userid'];
$sql="select * from relation where user_id={$user_id} order by id";
$rst=$mysqli->query($sql);

?>

<table border="1" cellspacing="0" width="100%">
	<tr>
		<td>姓名</td>
		<td>地址</td>
		<td>电话</td>
		<td>邮箱</td>
		<td>修改</td>
		<td>删除</td>
	</tr>
	<?php
		while($row=$rst->fetch_assoc()){
			echo "<tr>";
			echo "<td>{$row['name']}</td>";
			echo "<td>{$row['addr']}</td>";
			echo "<td>{$row['tel']}</td>";
			echo "<td>{$row['email']}</td>";
			echo "<td><a href='index.php?action=infoEdit&id={$row['id']}'>编辑</a></td>";
			echo "<td><a href='info/delete.php?id={$row['id']}'>删除</a></td>";
			echo "</tr>";
		}

	?>
</table>
